correct zero NMEA lat/lon on input
authoralexmot <alexmot@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 11 Nov 2005 20:44:20 +0000 (20:44 +0000)
committeralexmot <alexmot@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 11 Nov 2005 20:44:20 +0000 (20:44 +0000)
gpsbabel/csv_util.c

index 6bfbfc786d425edfcb1c43501e737f962552b715..a4e78e7590a86befd78bdca306f1456f38bddc2a 100644 (file)
@@ -802,7 +802,7 @@ xcsv_parse_val(const char *s, waypoint *wpt, const field_map_t *fmp)
        human_to_dec( s, &wpt->latitude, &wpt->longitude, 1 );
     } else
     if ( strcmp(fmp->key, "LAT_NMEA") == 0) {
-       wpt->latitude = ddmm2degrees(wpt->latitude);
+       wpt->latitude = ddmm2degrees(atof(s));
     } else
     /* LONGITUDE CONVERSIONS ***********************************************/
     if (strcmp(fmp->key, "LON_DECIMAL") == 0) {
@@ -822,7 +822,7 @@ xcsv_parse_val(const char *s, waypoint *wpt, const field_map_t *fmp)
        human_to_dec( s, &wpt->latitude, &wpt->longitude, 2 );
     } else
     if ( strcmp(fmp->key, "LON_NMEA") == 0) {
-       wpt->latitude = ddmm2degrees(wpt->longitude);
+       wpt->longitude = ddmm2degrees(atof(s));
     } else
     /* LAT AND LON CONVERSIONS ********************************************/
     if ( strcmp(fmp->key, "LATLON_HUMAN_READABLE") == 0) {